package org.bouncycastle.crypto.params;

import java.math.BigInteger;

import org.bouncycastle.math.ec.ECConstants;
import org.bouncycastle.math.ec.ECCurve;
import org.bouncycastle.math.ec.ECPoint;

/**
 * ECDomain参数
 * 
 * @author john.peng
 *
 */
public class ECDomainParameters implements ECConstants {
	ECCurve curve;
	byte[] seed;
	ECPoint G;
	BigInteger n;
	BigInteger h;

	/**
	 * 默认构造函数
	 * 
	 * @param curve 椭圆曲线
	 * @param G     ECPoint
	 * @param n     n
	 */
	public ECDomainParameters(ECCurve curve, ECPoint G, BigInteger n) {
		this.curve = curve;
		this.G = G;
		this.n = n;
		this.h = ONE;
		this.seed = null;
	}

	/**
	 * 默认构造函数
	 * 
	 * @param curve 椭圆曲线
	 * @param G     ECPoint
	 * @param n     n
	 * @param h     h
	 */
	public ECDomainParameters(ECCurve curve, ECPoint G, BigInteger n, BigInteger h) {
		this.curve = curve;
		this.G = G;
		this.n = n;
		this.h = h;
		this.seed = null;
	}

	/**
	 * 默认构造函数
	 * 
	 * @param curve 椭圆曲线
	 * @param G     ECPoint
	 * @param n     n
	 * @param h     h
	 * @param seed  seed
	 */
	public ECDomainParameters(ECCurve curve, ECPoint G, BigInteger n, BigInteger h, byte[] seed) {
		this.curve = curve;
		this.G = G;
		this.n = n;
		this.h = h;
		this.seed = seed;
	}

	/**
	 * 获取椭圆曲线
	 * 
	 * @return 椭圆曲线
	 */
	public ECCurve getCurve() {
		return curve;
	}

	/**
	 * 获取 g
	 * 
	 * @return g
	 */
	public ECPoint getG() {
		return G;
	}

	/**
	 * 获取n
	 * 
	 * @return n
	 */
	public BigInteger getN() {
		return n;
	}

	/**
	 * 获取h
	 * 
	 * @return h
	 */
	public BigInteger getH() {
		return h;
	}

	/**
	 * 获取seed
	 * 
	 * @return seed
	 */
	public byte[] getSeed() {
		return seed;
	}
}
